<?php

namespace App\Http\Controllers\User;

use App\Http\Controllers\Controller;
use App\Http\Requests\ErrorsRequest;
use App\Repositories\ErrorRepositories;
use Illuminate\Http\Request;

class ErrorsController extends Controller
{
    protected $repo;

    public function __construct(ErrorRepositories $repo)
    {
        $this->repo = $repo;
    }

    public function showform(Request $request)
    {
        $data = [];
        $data['question'] = $request->question;
        $data['section'] = $request->section;
        return view('user.question_errors', compact('data'));
    }

    public function store(ErrorsRequest $request)
    {
        return $this->repo->save($request);
    }

}
